#include "gailcontainercell.h"
#include "gailtextcell.h"
#include "gailcellparent.h"
-#include "gail-private-macros.h"
typedef struct _GailTreeViewCellInfo GailTreeViewCellInfo;
GtkAdjustment *adj;
GailTreeView *gailview;
- gail_return_if_fail (GTK_IS_TREE_VIEW (widget));
+ if (!GTK_IS_TREE_VIEW (widget))
+ return;
gailview = GAIL_TREE_VIEW (accessible);
adj = gailview->old_hadj;
{
GtkWidget *widget;
- gail_return_val_if_fail (GAIL_IS_TREE_VIEW (obj), 0);
+ if (!GAIL_IS_TREE_VIEW (obj))
+ return 0;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
if (widget == NULL)
tree_model = gtk_tree_view_get_model (tree_view);
retval = gtk_tree_model_get_iter (tree_model, &iter, path);
- gail_return_val_if_fail (retval, NULL);
+ if (!retval)
+ return NULL;
expander_tv = gtk_tree_view_get_expander_column (tree_view);
is_expander = FALSE;
GailCell *container_cell;
container = gail_container_cell_new ();
- gail_return_val_if_fail (container, NULL);
container_cell = GAIL_CELL (container);
gail_cell_initialise (container_cell,
- widget, ATK_OBJECT (gailview),
+ widget, ATK_OBJECT (gailview),
i);
/*
* The GailTreeViewCellInfo structure for the container will be before
G_OBJECT_TYPE (fake_renderer));
child = atk_object_factory_create_accessible (factory,
G_OBJECT (fake_renderer));
- gail_return_val_if_fail (GAIL_IS_RENDERER_CELL (child), NULL);
cell = GAIL_CELL (child);
renderer_cell = GAIL_RENDERER_CELL (child);
renderer_cell->renderer = fake_renderer;
G_OBJECT_TYPE (renderer));
child = atk_object_factory_create_accessible (factory,
G_OBJECT (renderer));
- gail_return_val_if_fail (GAIL_IS_RENDERER_CELL (child), NULL);
cell = GAIL_CELL (child);
renderer_cell = GAIL_RENDERER_CELL (child);
top_cell = cell;
}
cell_info = find_cell_info (GAIL_TREE_VIEW (parent), top_cell, TRUE);
- gail_return_if_fail (cell_info);
- gail_return_if_fail (cell_info->cell_col_ref);
- gail_return_if_fail (cell_info->cell_row_ref);
+ if (!cell_info || !cell_info->cell_col_ref || !cell_info->cell_row_ref)
+ return;
path = gtk_tree_row_reference_get_path (cell_info->cell_row_ref);
tv_col = cell_info->cell_col_ref;
if (path && cell_info->in_use)
tree_view = GTK_TREE_VIEW (widget);
cell_info = find_cell_info (GAIL_TREE_VIEW (parent), cell, TRUE);
- gail_return_val_if_fail (cell_info, FALSE);
- gail_return_val_if_fail (cell_info->cell_col_ref, FALSE);
- gail_return_val_if_fail (cell_info->cell_row_ref, FALSE);
+ if (!cell_info || !cell_info->cell_col_ref || !cell_info->cell_row_ref)
+ return FALSE;
cell_object = ATK_OBJECT (cell);
parent_cell = atk_object_get_parent (cell_object);
tv_col = cell_info->cell_col_ref;
traverse_cells (gailview, path, FALSE, FALSE);
/* Set collapse state */
set_expand_state (tree_view, tree_model, gailview, path, FALSE);
-
- gail_return_val_if_fail (gailview->n_children_deleted, FALSE);
+ if (gailview->n_children_deleted == 0)
+ return FALSE;
row = get_row_from_tree_path (tree_view, path);
- gail_return_val_if_fail (row != -1, FALSE);
+ if (row == -1)
+ return FALSE;
g_signal_emit_by_name (atk_obj, "row_deleted", row,
gailview->n_children_deleted);
gailview->n_children_deleted = 0;
AtkObject *atk_obj = gtk_widget_get_accessible (GTK_WIDGET (tree_view));
GailTreeView *gailview = GAIL_TREE_VIEW (atk_obj);
- gail_return_if_fail (gailview->n_children_deleted == 0);
+ if (gailview->n_children_deleted != 0)
+ return;
gailview->n_children_deleted = count;
}
cell = GAIL_CELL (renderer_cell);
cell_info = find_cell_info (gailview, cell, TRUE);
- gail_return_val_if_fail (cell_info, FALSE);
- gail_return_val_if_fail (cell_info->cell_col_ref, FALSE);
- gail_return_val_if_fail (cell_info->cell_row_ref, FALSE);
+ if (!cell_info || !cell_info->cell_col_ref || !cell_info->cell_row_ref)
+ return FALSE;
if (emit_change_signal && cell_info->in_use)
{
tree_model, &iter, is_expander, is_expanded);
}
renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (cell_info->cell_col_ref));
- gail_return_val_if_fail (renderers, FALSE);
+ if (!renderers)
+ return FALSE;
/*
* If the cell is in a container, its index is used to find the renderer
return FALSE;
}
- gail_return_val_if_fail (cur_renderer != NULL, FALSE);
+ if (cur_renderer == NULL)
+ return FALSE;
if (gtk_cell_renderer_class)
{
parent = atk_object_get_parent (parent);
cell_info = find_cell_info (GAIL_TREE_VIEW (parent), cell, TRUE);
- gail_return_if_fail (cell_info);
- gail_return_if_fail (cell_info->cell_col_ref);
- gail_return_if_fail (cell_info->cell_row_ref);
+ if (!cell_info || !cell_info->cell_col_ref || !cell_info->cell_row_ref)
+ return;
tree_view = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (parent)));
path = gtk_tree_row_reference_get_path (cell_info->cell_row_ref);
- gail_return_if_fail (path);
+ if (!path)
+ return;
stateset = atk_object_ref_state_set (ATK_OBJECT (cell));
if (atk_state_set_contains_state (stateset, ATK_STATE_EXPANDED))
}
cell_info = find_cell_info (GAIL_TREE_VIEW (parent), cell, TRUE);
- gail_return_if_fail (cell_info);
- gail_return_if_fail (cell_info->cell_col_ref);
- gail_return_if_fail (cell_info->cell_row_ref);
+ if (!cell_info || !cell_info->cell_col_ref || !cell_info->cell_row_ref)
+ return;
path = gtk_tree_row_reference_get_path (cell_info->cell_row_ref);
- gail_return_if_fail (path);
+ if (!path)
+ return;
pathstring = gtk_tree_path_to_string (path);
renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (cell_info->cell_col_ref));
- gail_return_if_fail (renderers);
+ if (!renderers)
+ return;
/*
* if the cell is in a container, its index is used to find the
*/
cur_renderer = renderers;
- gail_return_if_fail (cur_renderer);
+ if (!cur_renderer)
+ return;
g_signal_emit_by_name (cur_renderer->data, "toggled", pathstring);
g_list_free (renderers);
parent = atk_object_get_parent (parent);
cell_info = find_cell_info (GAIL_TREE_VIEW (parent), cell, TRUE);
- gail_return_if_fail (cell_info);
- gail_return_if_fail (cell_info->cell_col_ref);
- gail_return_if_fail (cell_info->cell_row_ref);
+ if (!cell_info || !cell_info->cell_col_ref || !cell_info->cell_row_ref)
+ return;
tree_view = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (parent)));
path = gtk_tree_row_reference_get_path (cell_info->cell_row_ref);
- gail_return_if_fail (path);
+ if (!path)
+ return;
gtk_tree_view_set_cursor (tree_view, path, cell_info->cell_col_ref, TRUE);
gtk_tree_path_free (path);
return;
parent = atk_object_get_parent (parent);
cell_info = find_cell_info (GAIL_TREE_VIEW (parent), cell, TRUE);
- gail_return_if_fail (cell_info);
- gail_return_if_fail (cell_info->cell_col_ref);
- gail_return_if_fail (cell_info->cell_row_ref);
+ if (!cell_info || !cell_info->cell_col_ref || !cell_info->cell_row_ref)
+ return;
tree_view = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (parent)));
path = gtk_tree_row_reference_get_path (cell_info->cell_row_ref);
- gail_return_if_fail (path);
+ if (!path)
+ return;
gtk_tree_view_row_activated (tree_view, path, cell_info->cell_col_ref);
gtk_tree_path_free (path);
return;
{
GailTreeViewCellInfo *cell_info = data;
- gail_return_if_fail (cell_info);
+ if (!cell_info)
+ return;
if (cell_info->in_use) {
cell_info->in_use = FALSE;
gint column_number;
path = gtk_tree_row_reference_get_path (info->cell_row_ref);
- gail_return_if_fail (path);
+ if (!path)
+ return;
column_number = get_column_number (tree_view, info->cell_col_ref, FALSE);
*index = get_index (tree_view, path, column_number);
gint index;
parent = atk_object_get_parent (ATK_OBJECT (cell));
- gail_return_if_fail (GAIL_IS_TREE_VIEW (parent));
+ if (!GAIL_IS_TREE_VIEW (parent))
+ return;
gailview = GAIL_TREE_VIEW (parent);
tree_view = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (parent)));
/* Find this cell in the GailTreeView's cache */
info = find_cell_info (gailview, cell, TRUE);
- gail_return_if_fail (info);
+ if (!info)
+ return;
cell_info_get_index (tree_view, info, &index);
cell->index = index;
row_index = index / gailview->n_cols;
retval = get_tree_path_from_row_index (tree_model, row_index, path);
- gail_return_val_if_fail (retval, FALSE);
+ if (!retval)
+ return FALSE;
if (*path == NULL)
return FALSE;
}
#endif
#include "gailwidget.h"
#include "gailnotebookpage.h"
-#include "gail-private-macros.h"
extern GtkWidget *focus_widget;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
if (widget == NULL)
- /*
- * State is defunct
- */
return NULL;
- gail_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
parent_widget = gtk_widget_get_parent (widget);
if (parent_widget == NULL)
AtkObject *array[1];
AtkRelation* relation;
- gail_return_val_if_fail (GAIL_IS_WIDGET (obj), NULL);
-
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
if (widget == NULL)
- /*
- * State is defunct
- */
return NULL;
relation_set = ATK_OBJECT_CLASS (gail_widget_parent_class)->ref_relation_set (obj);
}
}
- gail_return_val_if_fail (GTK_IS_WIDGET (widget), -1);
+ if (!GTK_IS_WIDGET (widget))
+ return -1;
parent_widget = gtk_widget_get_parent (widget);
- if (parent_widget == NULL)
+ if (!GTK_IS_CONTAINER (parent_widget))
return -1;
- gail_return_val_if_fail (GTK_IS_CONTAINER (parent_widget), -1);
children = gtk_container_get_children (GTK_CONTAINER (parent_widget));
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
if (widget == NULL)
- /*
- * Object is defunct
- */
return;
- gail_return_if_fail (GTK_IS_WIDGET (widget));
-
gtk_widget_get_allocation (widget, &allocation);
*width = allocation.width;
*height = allocation.height;
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
if (widget == NULL)
- /*
- * Object is defunct
- */
return;
- gail_return_if_fail (GTK_IS_WIDGET (widget));
-
gtk_widget_get_allocation (widget, &allocation);
*width = allocation.width;
*height = allocation.height;
return (AtkLayer) layer;
}
-static gboolean
+static gboolean
gail_widget_grab_focus (AtkComponent *component)
{
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
GtkWidget *toplevel;
- gail_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
+ if (!widget)
+ return FALSE;
+
if (gtk_widget_get_can_focus (widget))
{
gtk_widget_grab_focus (widget);
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
if (widget == NULL)
- /*
- * Object is defunct
- */
return FALSE;
- gail_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
if (gtk_widget_is_toplevel (widget))
{
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
if (widget == NULL)
- /*
- * Object is defunct
- */
return FALSE;
- gail_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
if (gtk_widget_is_toplevel (widget))
{
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
if (widget == NULL)
- /*
- * Object is defunct
- */
return FALSE;
- gail_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
if (gtk_widget_is_toplevel (widget))
{